package com.ling.sbbyyds.mapper.news;

import com.ling.sbbyyds.entity.news.ChatUserInfo;
import com.ling.sbbyyds.entity.news.UserChatRoom;
import com.ling.sbbyyds.entity.news.table.NewsChatMessage;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 聊天室数据库交互
 * @author ling
 */

@Repository
public interface ChatRoomMapper extends Mapper<UserChatRoom> {

    /**
     * 获取用户所有显式的聊天室ID
     * @param userId 用户ID
     * @return 用户将显示的聊天室ID
     */
    List<UserChatRoom> getShowChatRoomInfoList(Long userId);

    /**
     * 获取聊天室内所有用户信息
     * @param chatRoomId 聊天室ID
     * @return 用户信息列表
     */
    List<ChatUserInfo> queryChatRoomUserList(Long chatRoomId);

    List<NewsChatMessage> getChatRoomMessageList(Long chatRoomId);
}
